from PyQt5.QtWidgets import QApplication,QWidget,QVBoxLayout,QListView,QMessageBox
from PyQt5.QtCore import QStringListModel
import sys

class myListView(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("爱生命里的")
        self.resize(300,400)

        layout=QVBoxLayout()
        mylistV=QListView()
        listM=QStringListModel()
        self.lst=["列表中的内容1","列表中的内容2","列表中的内容3"]
        listM.setStringList(self.lst)

        mylistV.setModel(listM)
        mylistV.clicked.connect(self.clic)
        layout.addWidget(mylistV)
        self.setLayout(layout)

    def clic(self,item):
        QMessageBox.information(self,"QListView","您选择了第")

if __name__ == '__main__':
    app=QApplication(sys.argv)
    myc=myListView()
    myc.show()
    sys.exit(app.exec_())